for %z ep cfp dy cfop epf cfpf dyf cfopf
for %y vw ew vw5 ew5
read(t=xls, s={%z}{%y}, c2) 2021.xls 30

table(7,10) alpha63_{%z}{%y}
setcell(alpha63_{%z}{%y},1,2,"Low")
setcell(alpha63_{%z}{%y},1,3,"IVol2")
setcell(alpha63_{%z}{%y},1,4,"IVol3")
setcell(alpha63_{%z}{%y},1,5,"IVol4")
setcell(alpha63_{%z}{%y},1,6,"High")
setcell(alpha63_{%z}{%y},1,7,"L-H")
setcell(alpha63_{%z}{%y},2,1,"Zero/Neg")
setcell(alpha63_{%z}{%y},3,1,"t-stat")
setcell(alpha63_{%z}{%y},4,1,"Low")
setcell(alpha63_{%z}{%y},5,1,"t-stat")
setcell(alpha63_{%z}{%y},6,1,"Quint2")
setcell(alpha63_{%z}{%y},7,1,"t-stat")
setcell(alpha63_{%z}{%y},8,1,"Quint3")
setcell(alpha63_{%z}{%y},9,1,"t-stat")
setcell(alpha63_{%z}{%y},10,1,"Quint4")
setcell(alpha63_{%z}{%y},11,1,"t-stat")
setcell(alpha63_{%z}{%y},12,1,"High")
setcell(alpha63_{%z}{%y},13,1,"t-stat")
setcell(alpha63_{%z}{%y},14,1,"H-L")
setcell(alpha63_{%z}{%y},15,1,"t(H-L)")
setcell(alpha63_{%z}{%y},16,1,"H-Z")
setcell(alpha63_{%z}{%y},17,1,"t(H-Z)")

for !i=0 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt
setcell(alpha63_{%z}{%y},2*!i+2,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alpha63_{%z}{%y},2*!i+3,!j+1,eq{!i}{!j}.@tstats(1))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt
setcell(alpha63_{%z}{%y},2*!i+2,7,eq{!i}.@coefs(1))
setcell(alpha63_{%z}{%y},2*!i+3,7,eq{!i}.@tstats(1))
equation equ{!j}.ls(n) -(port{!j}1-port{!j}5) c mkt
setcell(alpha63_{%z}{%y},14,!j+1,equ{!j}.@coefs(1))
setcell(alpha63_{%z}{%y},15,!j+1,equ{!j}.@tstats(1))
equation equ{!j}.ls(n) -(port{!j}0-port{!j}5) c mkt
setcell(alpha63_{%z}{%y},16,!j+1,equ{!j}.@coefs(1))
setcell(alpha63_{%z}{%y},17,!j+1,equ{!j}.@tstats(1))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) (port11-port51-port15+port55) c mkt
setcell(alpha63_{%z}{%y},14,7,eq.@coefs(1))
setcell(alpha63_{%z}{%y},15,7,eq.@tstats(1))
equation eq.ls(n) (port10-port50-port15+port55) c mkt
setcell(alpha63_{%z}{%y},16,7,eq.@coefs(1))
setcell(alpha63_{%z}{%y},17,7,eq.@tstats(1))
delete eq

table(7,10) alpha86_{%z}{%y}
setcell(alpha86_{%z}{%y},1,2,"Low")
setcell(alpha86_{%z}{%y},1,3,"IVol2")
setcell(alpha86_{%z}{%y},1,4,"IVol3")
setcell(alpha86_{%z}{%y},1,5,"IVol4")
setcell(alpha86_{%z}{%y},1,6,"High")
setcell(alpha86_{%z}{%y},1,7,"L-H")
setcell(alpha86_{%z}{%y},2,1,"Zero/Neg")
setcell(alpha86_{%z}{%y},3,1,"t-stat")
setcell(alpha86_{%z}{%y},4,1,"Low")
setcell(alpha86_{%z}{%y},5,1,"t-stat")
setcell(alpha86_{%z}{%y},6,1,"Quint2")
setcell(alpha86_{%z}{%y},7,1,"t-stat")
setcell(alpha86_{%z}{%y},8,1,"Quint3")
setcell(alpha86_{%z}{%y},9,1,"t-stat")
setcell(alpha86_{%z}{%y},10,1,"Quint4")
setcell(alpha86_{%z}{%y},11,1,"t-stat")
setcell(alpha86_{%z}{%y},12,1,"High")
setcell(alpha86_{%z}{%y},13,1,"t-stat")
setcell(alpha86_{%z}{%y},14,1,"H-L")
setcell(alpha86_{%z}{%y},15,1,"t(H-L)")
setcell(alpha86_{%z}{%y},16,1,"H-Z")
setcell(alpha86_{%z}{%y},17,1,"t(H-Z)")

smpl if fvix5<>na
for !i=0 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt
setcell(alpha86_{%z}{%y},2*!i+2,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alpha86_{%z}{%y},2*!i+3,!j+1,eq{!i}{!j}.@tstats(1))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt
setcell(alpha86_{%z}{%y},2*!i+2,7,eq{!i}.@coefs(1))
setcell(alpha86_{%z}{%y},2*!i+3,7,eq{!i}.@tstats(1))
equation equ{!j}.ls(n) -(port{!j}1-port{!j}5) c mkt
setcell(alpha86_{%z}{%y},14,!j+1,equ{!j}.@coefs(1))
setcell(alpha86_{%z}{%y},15,!j+1,equ{!j}.@tstats(1))
equation equ{!j}.ls(n) -(port{!j}0-port{!j}5) c mkt
setcell(alpha86_{%z}{%y},16,!j+1,equ{!j}.@coefs(1))
setcell(alpha86_{%z}{%y},17,!j+1,equ{!j}.@tstats(1))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) (port11-port51-port15+port55) c mkt
setcell(alpha86_{%z}{%y},14,7,eq.@coefs(1))
setcell(alpha86_{%z}{%y},15,7,eq.@tstats(1))
equation eq.ls(n) (port10-port50-port15+port55) c mkt
setcell(alpha86_{%z}{%y},16,7,eq.@coefs(1))
setcell(alpha86_{%z}{%y},17,7,eq.@tstats(1))
delete eq

table(7,10) alphaicapm_{%z}{%y}
setcell(alphaicapm_{%z}{%y},1,2,"Low")
setcell(alphaicapm_{%z}{%y},1,3,"IVol2")
setcell(alphaicapm_{%z}{%y},1,4,"IVol3")
setcell(alphaicapm_{%z}{%y},1,5,"IVol4")
setcell(alphaicapm_{%z}{%y},1,6,"High")
setcell(alphaicapm_{%z}{%y},1,7,"L-H")
setcell(alphaicapm_{%z}{%y},2,1,"Zero/Neg")
setcell(alphaicapm_{%z}{%y},3,1,"t-stat")
setcell(alphaicapm_{%z}{%y},4,1,"Low")
setcell(alphaicapm_{%z}{%y},5,1,"t-stat")
setcell(alphaicapm_{%z}{%y},6,1,"Quint2")
setcell(alphaicapm_{%z}{%y},7,1,"t-stat")
setcell(alphaicapm_{%z}{%y},8,1,"Quint3")
setcell(alphaicapm_{%z}{%y},9,1,"t-stat")
setcell(alphaicapm_{%z}{%y},10,1,"Quint4")
setcell(alphaicapm_{%z}{%y},11,1,"t-stat")
setcell(alphaicapm_{%z}{%y},12,1,"High")
setcell(alphaicapm_{%z}{%y},13,1,"t-stat")
setcell(alphaicapm_{%z}{%y},14,1,"H-L")
setcell(alphaicapm_{%z}{%y},15,1,"t(H-L)")
setcell(alphaicapm_{%z}{%y},16,1,"H-Z")
setcell(alphaicapm_{%z}{%y},17,1,"t(H-Z)")

table(7,10) betafvix_{%z}{%y}
setcell(betafvix_{%z}{%y},1,2,"Low")
setcell(betafvix_{%z}{%y},1,3,"IVol2")
setcell(betafvix_{%z}{%y},1,4,"IVol3")
setcell(betafvix_{%z}{%y},1,5,"IVol4")
setcell(betafvix_{%z}{%y},1,6,"High")
setcell(betafvix_{%z}{%y},1,7,"L-H")
setcell(betafvix_{%z}{%y},2,1,"Zero/Neg")
setcell(betafvix_{%z}{%y},3,1,"t-stat")
setcell(betafvix_{%z}{%y},4,1,"Low")
setcell(betafvix_{%z}{%y},5,1,"t-stat")
setcell(betafvix_{%z}{%y},6,1,"Quint2")
setcell(betafvix_{%z}{%y},7,1,"t-stat")
setcell(betafvix_{%z}{%y},8,1,"Quint3")
setcell(betafvix_{%z}{%y},9,1,"t-stat")
setcell(betafvix_{%z}{%y},10,1,"Quint4")
setcell(betafvix_{%z}{%y},11,1,"t-stat")
setcell(betafvix_{%z}{%y},12,1,"High")
setcell(betafvix_{%z}{%y},13,1,"t-stat")
setcell(betafvix_{%z}{%y},14,1,"H-L")
setcell(betafvix_{%z}{%y},15,1,"t(H-L)")
setcell(betafvix_{%z}{%y},16,1,"H-Z")
setcell(betafvix_{%z}{%y},17,1,"t(H-Z)")

table(7,10) betafivol_{%z}{%y}
setcell(betafivol_{%z}{%y},1,2,"Low")
setcell(betafivol_{%z}{%y},1,3,"IVol2")
setcell(betafivol_{%z}{%y},1,4,"IVol3")
setcell(betafivol_{%z}{%y},1,5,"IVol4")
setcell(betafivol_{%z}{%y},1,6,"High")
setcell(betafivol_{%z}{%y},1,7,"L-H")
setcell(betafivol_{%z}{%y},2,1,"Zero/Neg")
setcell(betafivol_{%z}{%y},3,1,"t-stat")
setcell(betafivol_{%z}{%y},4,1,"Low")
setcell(betafivol_{%z}{%y},5,1,"t-stat")
setcell(betafivol_{%z}{%y},6,1,"Quint2")
setcell(betafivol_{%z}{%y},7,1,"t-stat")
setcell(betafivol_{%z}{%y},8,1,"Quint3")
setcell(betafivol_{%z}{%y},9,1,"t-stat")
setcell(betafivol_{%z}{%y},10,1,"Quint4")
setcell(betafivol_{%z}{%y},11,1,"t-stat")
setcell(betafivol_{%z}{%y},12,1,"High")
setcell(betafivol_{%z}{%y},13,1,"t-stat")
setcell(betafivol_{%z}{%y},14,1,"H-L")
setcell(betafivol_{%z}{%y},15,1,"t(H-L)")
setcell(betafivol_{%z}{%y},16,1,"H-Z")
setcell(betafivol_{%z}{%y},17,1,"t(H-Z)")

smpl if fvix5<>na
for !i=0 to 5
for !j=1 to 5
equation eq{!i}{!j}.ls(n) port{!j}{!i}-rf c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},2*!i+2,!j+1,eq{!i}{!j}.@coefs(1))
setcell(alphaicapm_{%z}{%y},2*!i+3,!j+1,eq{!i}{!j}.@tstats(1))
setcell(betafvix_{%z}{%y},2*!i+2,!j+1,eq{!i}{!j}.@coefs(3))
setcell(betafvix_{%z}{%y},2*!i+3,!j+1,eq{!i}{!j}.@tstats(3))
setcell(betafivol_{%z}{%y},2*!i+2,!j+1,eq{!i}{!j}.@coefs(4))
setcell(betafivol_{%z}{%y},2*!i+3,!j+1,eq{!i}{!j}.@tstats(4))
equation eq{!i}.ls(n) port1{!i}-port5{!i} c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},2*!i+2,7,eq{!i}.@coefs(1))
setcell(alphaicapm_{%z}{%y},2*!i+3,7,eq{!i}.@tstats(1))
setcell(betafvix_{%z}{%y},2*!i+2,7,eq{!i}.@coefs(3))
setcell(betafvix_{%z}{%y},2*!i+3,7,eq{!i}.@tstats(3))
setcell(betafivol_{%z}{%y},2*!i+2,7,eq{!i}.@coefs(4))
setcell(betafivol_{%z}{%y},2*!i+3,7,eq{!i}.@tstats(4))
equation equ{!j}.ls(n) -(port{!j}1-port{!j}5) c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},14,!j+1,equ{!j}.@coefs(1))
setcell(alphaicapm_{%z}{%y},15,!j+1,equ{!j}.@tstats(1))
setcell(betafvix_{%z}{%y},14,!j+1,equ{!j}.@coefs(3))
setcell(betafvix_{%z}{%y},15,!j+1,equ{!j}.@tstats(3))
setcell(betafivol_{%z}{%y},14,!j+1,equ{!j}.@coefs(4))
setcell(betafivol_{%z}{%y},15,!j+1,equ{!j}.@tstats(4))
equation equ{!j}.ls(n) -(port{!j}0-port{!j}5) c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},16,!j+1,equ{!j}.@coefs(1))
setcell(alphaicapm_{%z}{%y},17,!j+1,equ{!j}.@tstats(1))
setcell(betafvix_{%z}{%y},16,!j+1,equ{!j}.@coefs(3))
setcell(betafvix_{%z}{%y},17,!j+1,equ{!j}.@tstats(3))
setcell(betafivol_{%z}{%y},16,!j+1,equ{!j}.@coefs(4))
setcell(betafivol_{%z}{%y},17,!j+1,equ{!j}.@tstats(4))
delete eq{!i}{!j} eq{!i} equ{!j}
next
next

equation eq.ls(n) (port11-port51-port15+port55) c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},14,7,eq.@coefs(1))
setcell(alphaicapm_{%z}{%y},15,7,eq.@tstats(1))
setcell(betafvix_{%z}{%y},14,7,eq.@coefs(3))
setcell(betafvix_{%z}{%y},15,7,eq.@tstats(3))
setcell(betafivol_{%z}{%y},14,7,eq.@coefs(4))
setcell(betafivol_{%z}{%y},15,7,eq.@tstats(4))
equation eq.ls(n) (port10-port50-port15+port55) c mkt fvix5 fivol
setcell(alphaicapm_{%z}{%y},16,7,eq.@coefs(1))
setcell(alphaicapm_{%z}{%y},17,7,eq.@tstats(1))
setcell(betafvix_{%z}{%y},16,7,eq.@coefs(3))
setcell(betafvix_{%z}{%y},17,7,eq.@tstats(3))
setcell(betafivol_{%z}{%y},16,7,eq.@coefs(4))
setcell(betafivol_{%z}{%y},17,7,eq.@tstats(4))
delete eq

for !i=1 to 5
for !j=0 to 5
delete port{!i}{!j}
next
next

smpl @all
next
next


